package com.hyinghua.pojod对Bean注解;

/**
 * Product class
 *
 * @author chenyeqing
 * @date 2020/12/28
 */
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


//告诉spring容器这是个Bean叫做”p“,等价于 <bean id="p" class="com.hyinghua.pojod对Bean注解.Product"></bean>
@Component("Product")
public class Product {
    private String name="Product 1";
    private int age;

    @Autowired
    private Category category;

    public Category getCategory() {
        return category;
    }
    public void setCategory(Category category) {
        this.category = category;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }

}
